
#include <BFont>
#include <BOpenGL>
#include <BPainter>
#include <BSizePolicy>

#include "member_BTableItem.h"
#include "member_BTableWidget.h"

using namespace BWE;

member_BTableItem::member_BTableItem(BTableItem* tableItem) : IAlignItem(tableItem)
{
	table = 0;
	row = -1;
	column = -1;
	visible = true;
	selected = false;
	checked = false;
}
member_BTableItem::~member_BTableItem()
{

}

bool member_BTableItem::empty() const
{
	return !widget && block.text.empty();
}
bool member_BTableItem::ignored() const
{
	if (widget)
		return !widget->visible();
	return block.text.empty();
}

void member_BTableItem::dirtyCell()
{
	if (table)
	{
		table_member(table)->dirtyItems = true;
		table_member(table)->rowHeader.dirty = true;
		table_member(table)->columnHeader.dirty = true;
		table_member(table)->columnHeader.headers[column].dirty= true;
		table_member(table)->columnHeader.headers[column].dirtyItems = true;
		table_member(table)->rowHeader.headers[row].dirty= true;
		table_member(table)->rowHeader.headers[row].dirtyItems = true;
		table->fresh();
	}
}
